<?php
    $attribute = pc_variable("attribute");
    $name = pc_variable("name");
    $value = pc_variable("value");
    $errors = pc_variable("errors");
    if($errors !== null && $errors->get($name) !== null) {
        $value = pc_variable("entity." . $name);
    } else if($value !== null) {
        $value = pc_format_date($value, pc_message("localization.dateFormat"));
    }
?>
<label for="entity.<?php pc_echo($name); ?>"<?php if($attribute->isRequired()) { ?> class="required"<?php } ?>><?php pc_echo(pc_message("field." . $name)); ?></label>
<input type="hidden" name="entity.<?php pc_echo($name); ?>.format" value="<?php pc_echo(pc_message("localization.dateFormat")); ?>"/>
<input type="text" id="entity.<?php pc_echo($name); ?>" name="entity.<?php pc_echo($name); ?>" value="<?php pc_echo($value); ?>"/>
(<?php pc_echo(pc_message("localization.dateHint")); ?>)<br/>